<template>
  <view>
    <uni-popup ref="message" type="center">
      <view class="permission-bc" style="width: 540rpx; height: 676rpx">
        <view style="height: 73%"></view>
        <view @click="selectPicture" class="d-center" style="height: 78rpx; color: #fff; font-size: 32rpx">马上开启 </view>
        <view @click="closeMessage" class="d-center" style="height: 78rpx; font-size: 28rpx; color: #999999">以后再说 </view>
      </view>
    </uni-popup>
    <view class="" v-if="tabIndex === 0">
      <view class="" v-if="onData.status > 2 || onData.status < 1">
        <view class="tip">根据国家要求规定，认证护士需进行身份核实</view>
        <view class="positive"> <view class="left"></view>护士资格证书 </view>
        <view
          class="upload"
          @click="openMessage('first')"
          style="background: url(../../../static/img/iden/zhengshu.png); background-size: 488rpx 324rpx"
        >
          <image :src="this.data1.nursePicture" mode="aspectFit"></image>
        </view>
        <view class="head"> 点击上传带章页、姓名页  </view>

        <view class="positive"> <view class="left"></view>护士执业证书 </view>
        <view class="time">
          <text class="name">注册有效期至：</text>
          <view class="value">
            <view class="" v-if="onData.status == 2" style="color: rgba(0, 0, 0, 0.38); text-align: right" @click="remind()">
              {{ onData.expirationDate }}
            </view>
            <biaofun-datetime-picker
              :placeholder="showPicker"
              v-else
              :start="currentDate"
              end="2100-10-28"
              fields="day"
              style="color: rgba(0, 0, 0, 0.38)"
              @change="changeDatetimePicker"
            >
            </biaofun-datetime-picker>
          </view>
          <image src="../../../static/icon/set-code/nav-back.png" mode=""></image>
        </view>
        <view class="zsType time" v-if="onData.status != 2">
          <text class="name">证书类型</text>
          <view class="type">
            <view
              :class="['type1', index == dataType ? 'type2' : '']"
              style="position: relative"
              v-for="(item, index) in zsType"
              :key="index"
              @click="typeChange(index)"
            >
              {{ item }}
              <view class="dui" v-show="index == dataType">
                <image src="../../../static/img/iden/dui.png" mode="" style="width: 16rpx; height: 16rpx"></image>
              </view>
            </view>
          </view>
        </view>
        <!-- 上传首页 -->
        <view class="box" v-for="(item, index) in showType" :key="index">
          <view class="upload" @click="openMessage('picture', item)" :style="item.bg">
            <image :src="item.src" mode="aspectFit"></image>
          </view>
          <view class="head" v-if="onData.status != 2"> 点击上传{{ item.txt }} </view>
        </view>
        <!-- 拍摄提示 -->
        <view class="" style="width: 100%; height: 320rpx; box-sizing: border-box">
          <view class="positive"> <view class="left"></view>拍摄须知 </view>
          <view class="demo">
            <view class="demo1" v-for="(item, index) in demo2" :key="index" style="width: 132rpx; height: 88rpx">
              <image :src="item.src" mode="aspectFit" style="width: 132rpx; height: 88rpx"></image>

              <view class="demo2"
                ><text :style="item.style">{{ item.judge }}</text
                >{{ item.txt }}</view
              >
            </view>
          </view>
        </view>
      </view>
      <!-- 其他信息 -->
      <view class="" style="">
        <view class="positive" v-if="onData.status > 2 || onData.status < 1"> <view class="left"></view>其他信息 </view>
        <view class="time" v-for="(item, index) in list" :key="item.txt">
          <text class="name">{{ item.txt }}</text>
          <template v-if="index == 0">
            <input
              class="value other"
              type="text"
              v-model="data1.hospital"
              :placeholder="item.pla"
              :disabled="editStatus == 1 && (onData.status == 2 || onData.status == 1)"
            />
            <image src="../../../static/icon/set-code/nav-back.png" mode="" @click="change(index)"></image>
          </template>
          <!-- 所属医院 -->
          <template v-else-if="index == 6">
            <input
              class="value other"
              type="text"
              v-model="data1.hospitalAddress"
              :placeholder="item.pla"
              :disabled="editStatus == 1 && (onData.status == 2 || onData.status == 1)"
            />
            <image src="../../../static/icon/set-code/nav-back.png" mode="" @click="change(index)"></image>
          </template>
		 <!-- 医生简介 -->
		 <template v-else-if="index == 7">
		   <textarea
		     class="value other-textarea "
		     type="text"
			 :auto-height="true"
		     v-model="data1.nurseSynopsis"
		     :placeholder="item.pla"
		     :disabled="editStatus == 1 && (onData.status == 2 || onData.status == 1)"
		   />
		   <!-- <image src="../../../static/icon/set-code/nav-back.png" mode="" @click="change(index)"></image> -->
		 </template>
          <template v-else>
            <input
              type="text"
              class="value other"
              disabled="true"
              v-model="item.value"
              :placeholder="item.pla"
              @click="change(index)"
              placeholder-style="color:#999999;"
            />
            <image src="../../../static/icon/set-code/nav-back.png" mode="" @click="change(index)"></image>
          </template>
        </view>
        <view class="update-btn1">
          <button
            class="update-btn d-center"
            v-if="editStatus == 1 && (onData.status == 2 || onData.status == 1)"
            @click="updateInfo(nurseId)"
          >
            更新职业资格证书
          </button>
        </view>
        <!-- ||onData.status==1 -->
        <view class="" style="padding-bottom: 100rpx" v-if="editStatus == 1 && onData.status == 2 && oRcodeImg">
          <view class="text-center"> {{ city }}护士小鹿护士接单群 </view>
          <view class="d-center">
            <image :src="oRcodeImg" class="or-img" mode="" @click="previewImage"></image>
          </view>

          <view class="mar" style="width: 85%">
            您已经成功完成资质认证，根据您所在的地址信息，邀请您进入本地护士群，可将二维码保存至手机，通过微信扫码加入群聊
          </view>
        </view>
        <!-- 拒绝原因 -->
        <view class="" v-if="onData.subStatus == 3" style="color: crimson; padding: 5%">
          您的申请已被拒绝，请重新提交： <br />拒绝原因：{{ onData.reason }}
        </view>
      </view>
      <uni-popup ref="popup" type="center">
        <view class="pop">
          <view class="popTitle">{{ this.popTitle }}</view>
          <!-- 科室和职称弹窗 -->
          <scroll-view scroll-y="true" style="height: 442rpx; padding-left: 30rpx; box-sizing: border-box">
            <!-- 科室多选 -->
            <radio-group @change="checkboxChange" v-if="this.popList == 1">
              <label class="" v-for="(item, index) in section" :key="index" style="margin-top: 30rpx; display: flex">
                <view class="hosptial">
                  <radio :value="item" color="#3c8eff" style="transform: scale(0.7); 'color':#3c8eff ; border-radius: 50%" />
                </view>
                <view>{{ item }}</view>
              </label>
            </radio-group>
            <!-- 职位单选 -->
            <radio-group @change="radioChange" v-if="this.popList == 2">
              <label class="" v-for="(item, index) in nurse" :key="index" style="margin-top: 30rpx; display: flex">
                <view>
                  <radio :value="item" color="#3c8eff" style="transform: scale(0.7); color: #3c8eff" />
                </view>
                <view>{{ item }}</view>
              </label>
            </radio-group>
            <!-- 选择年限弹窗 -->
            <radio-group @change="yearChange" v-if="this.popList == 3">
              <label class="" v-for="(item, index) in year" :key="index" style="margin-top: 30rpx; display: flex">
                <view>
                  <radio :value="item" color="#3c8eff" style="transform: scale(0.7); color: #3c8eff" />
                </view>
                <view>{{ item }}</view>
              </label>
            </radio-group>
            <!-- 选择服务类目弹窗 -->
            <view class="uni-list" style="margin-left: 140rpx" v-if="this.popList == 4">
              <checkbox-group @change="itemChange">
                <label class="uni-list-cell uni-list-cell-pd" v-for="item in itemOptions" :key="item.id">
                  <view> <checkbox :value="item.value" :checked="item.checked" />{{ item.value }} </view>
                  <view>{{ item.name }}</view>
                </label>
              </checkbox-group>
            </view>
          </scroll-view>

          <view class="confirm">
            <view class="" @click="popDel">取消</view>
            <view class="" @click="confirm" style="border-left: 1rpx #e5e5e5 solid; color: #3c8eff">确定 </view>
          </view>
        </view>
      </uni-popup>

      <view class="myinto" v-if="onData.status > 2 || onData.status < 1">
        <view class="font-sm flex align-center agree" style="margin-top: 57rpx">
          <checkbox-group name="" @change="checkboxChangeSure">
            <label>
              <checkbox color="#3C8EFF" style="transform: scale(0.5); color: #3c8eff" />
            </label>
          </checkbox-group>
          <text class="text-secondary bottomStyle">请仔细阅读</text>
          <text class="main-text-color bottomStyle" @click="nurseNeed()">《护士上门服务工作流程》</text>
        </view>
      </view>
      <view class="into" v-if="onData.status > 2 || onData.status < 1">
        <view class="save" @click="save(nurseId)">提交</view>
      </view>
    </view>
    <uni-confirm :show="confirmShow" title="请先在首页设置位置信息" content="" @cancel="bindBtn('cancel')" @confirm="bindBtn('confirm')">
    </uni-confirm>
    <!-- 执业认证 -->
    <view class="" v-if="tabIndex === 1">
      <view class="tip">根据国家要求规定，认证护工需进行身份核实</view>
      <!-- 上传护工证 -->
      <view class="">
        <view class="positive"> <view class="left"></view>上传护工证 </view>
        <view
          class="upload"
          @click="idCareCard()"
          style="background: url(../../../static/img/iden/zhengshu.png); background-size: 488rpx 324rpx"
        >
          <image :src="caregiverPicture" mode="aspectFit"></image>
          <!-- <image src="../../../static/img/iden/seal.png" mode="aspectFit" class="seal" v-if="num < 0"></image> -->
        </view>
        <view class="head"> 点击上传带章页、姓名页 </view>
      </view>
      <!-- 上传身份证 -->
      <view class="">
        <!-- 正面 -->
        <view class="positive">
          <view class="left"></view>身份证照片
          <view class="" style="color: red; font-size: 25rpx"> （若没有护工证书，请上传身份证正反面） </view>
        </view>

        <view class="upload" @click="idCard()" style="background: url(../../../static/img/iden/card.png); background-size: 488rpx 324rpx">
          <image :src="cardSrcBefore" mode="aspectFit"></image>
        </view>
        <view class="head"> 点击上传头像正面 </view>
        <!-- 反面 -->
        <view
          class="upload"
          @click="idCardBack()"
          style="background: url(../../../static/img/iden/card.png); background-size: 488rpx 324rpx"
        >
          <image :src="cardSrcBack" mode="aspectFit"></image>
          <!-- <image src="../../../static/img/iden/seal.png" mode="aspectFit" class="seal" v-if="num < 0"></image> -->
        </view>
        <view class="head"> 点击上传头像反面 </view>
        <!-- 拍摄提示 -->
        <view class="" style="width: 100%; height: 532rpx; box-sizing: border-box" v-if="!cardSrcBefore">
          <view class="positive"> <view class="left"></view>拍摄须知 </view>
          <view class="demo">
            <view class="demo1" v-for="(item, index) in demo1" :key="index" style="width: 132rpx; height: 88rpx">
              <image :src="item.src" mode="aspectFit" style="width: 132rpx; height: 88rpx"></image>

              <view class="demo2"
                ><text :style="item.style">{{ item.judge }}</text
                >{{ item.txt }}</view
              >
            </view>
          </view>
        </view>

        <!-- 身份证上传失败显示 -->
        <view class="lose" v-else>
          <view class="loseTip">
            <view class="tanhao icon-a-qingkongpng iconfont" v-if="num > 0"></view>
            <view class="loseReason">{{ num > 0 ? '失败原因：您的网络信号不佳' : '' }}</view>
          </view>
          <view class="please">
            <view class="">请联系护士小鹿客服400-880-9120</view>
            <view class="">上班时间：工作日（9:00~17:30）</view>
          </view>
        </view>
      </view>
      <!-- 拒绝原因 -->
      <view class="" v-if="onData.subStatus == 3" style="color: crimson; padding: 5%">
        您的申请已被拒绝，请重新提交： <br />拒绝原因：{{ onData.reason }}
      </view>
      <view class="saveinto" v-if="isSaveCare">
        <view class="saveCare" @click="saveCare">提交</view>
      </view>
      <view class="saveinto" v-else>
        <view class="saveCare" @click="saveCare">重新提交</view>
      </view>
    </view>
    <!-- 理疗师认证 陪诊员 -->
    <view class="" v-if="[2, 5].includes(tabIndex)">
      <view class="tip">根据国家要求规定，上门护理需进行身份核实</view>
      <!-- 上传身份证 -->
      <view class="">
        <!-- 正面 -->
        <view class="positive"> <view class="left"></view>身份证照片 </view>

        <view class="upload" @click="idCard()" style="background: url(../../../static/img/iden/card.png); background-size: 488rpx 324rpx">
          <image :src="cardSrcBefore" mode="aspectFit"></image>
        </view>
        <view class="head"> 点击上传头像正面 </view>
        <!-- 反面 -->
        <view
          class="upload"
          @click="idCardBack()"
          style="background: url('http://loto.oss-cn-shanghai.aliyuncs.com/email/63476986b5de4707.png'); background-size: 488rpx 324rpx"
        >
          <image :src="cardSrcBack" mode="aspectFit"></image>
          <!-- <image src="../../../static/img/iden/seal.png" mode="aspectFit" class="seal" v-if="num < 0"></image> -->
        </view>
        <view class="head"> 点击上传头像反面 </view>
        <!-- 拍摄提示 -->
        <view class="" style="width: 100%; height: 532rpx; box-sizing: border-box" v-if="!cardSrcBefore">
          <view class="positive"> <view class="left"></view>拍摄须知 </view>
          <view class="demo">
            <view class="demo1" v-for="(item, index) in demo1" :key="index" style="width: 132rpx; height: 88rpx">
              <image :src="item.src" mode="aspectFit" style="width: 132rpx; height: 88rpx"></image>

              <view class="demo2"
                ><text :style="item.style">{{ item.judge }}</text
                >{{ item.txt }}</view
              >
            </view>
          </view>
        </view>

        <!-- 身份证上传失败显示 -->
        <view class="lose" v-else>
          <view class="loseTip">
            <view class="tanhao icon-a-qingkongpng iconfont" v-if="num > 0"></view>
            <view class="loseReason">{{ num > 0 ? '失败原因：您的网络信号不佳' : '' }}</view>
          </view>
          <view class="please">
            <view class="">请联系护士小鹿客服400-880-9120</view>
            <view class="">上班时间：工作日（9:00~17:30）</view>
          </view>
        </view>
      </view>
      <!-- 拒绝原因 -->
      <view class="" v-if="onData.subStatus == 3" style="color: crimson; padding: 5%">
        您的申请已被拒绝，请重新提交： <br />拒绝原因：{{ onData.reason }}
      </view>
      <view class="saveinto" v-if="isSaveCare">
        <view class="saveCare" @click="savePhysiotherapy">提交</view>
      </view>
      <view class="saveinto" v-else>
        <view class="saveCare" @click="savePhysiotherapy">重新提交</view>
      </view>
    </view>
    <!-- 康复师认证 -->
    <view class="" v-if="tabIndex === 3">
      <view class="tip">根据国家要求规定，认证康复师需进行身份核实</view>
      <!-- 上传护工证 -->
      <view class="">
        <view class="positive"> <view class="left"></view>上传康复师职业资格证书 </view>
        <view
          class="upload"
          @click="idCareCard()"
          style="background: url(../../../static/img/iden/zhengshu.png); background-size: 488rpx 324rpx"
        >
          <image :src="caregiverPicture" mode="aspectFit"></image>
          <!-- <image src="../../../static/img/iden/seal.png" mode="aspectFit" class="seal" v-if="num < 0"></image> -->
        </view>
        <view class="head"> 点击上传带章页、姓名页 </view>
      </view>
      <!-- 上传身份证 -->

      <!-- 拒绝原因 -->
      <view class="" v-if="onData.subStatus == 3" style="color: crimson; padding: 5%">
        您的申请已被拒绝，请重新提交： <br />拒绝原因：{{ onData.reason }}
      </view>
      <view class="saveinto" v-if="isSaveCare">
        <view class="saveCare" @click="saveRecovered">提交</view>
      </view>
      <view class="saveinto" v-else>
        <view class="saveCare" @click="saveRecovered">重新提交</view>
      </view>
    </view>
  </view>
</template>

<script>
import biaofunDatetimePicker from '@/components/uni-ui/biaofun-datetime-picker/biaofun-datetime-picker.vue'
import uniConfirm from '@/components/uni-ui/uni-confirm/uni-confirm.vue'
import uniPopup from '../../../components/uni-ui/uni-popup/uni-popup.vue'
import uploadImage from '@/common/js/ossutil/uploadFile.js'
import uniNumberBox from '../../../components/uni-ui/uni-number-box/uni-number-box.vue'
import { translateapp } from '../../../common/js/common.js'
import { idCardCheck, faceCheck } from '@/apis/nurse/index.js'
import { orCodeInfo } from '../../../common/js/orCode.js'
import { selectNurseInfoCheckById, nurseCheckInfo } from '@/apis/certificate/certification.js'
import { debounce } from '@/common/js/throttle.js'
import { requestAndroid } from '@/common/js/location.js'
import { getLoginInfo } from '@/apis/login/index.js'
import permision from '@/common/js/permission.js'
export default {
  components: {
    biaofunDatetimePicker,
    uniPopup,
    uniNumberBox,
    uniConfirm
  },
  data() {
    return {
      touchStartTime: 0,
      oRcodeImg: '',
      loc: -1,
      refuse: '',
      isSaveCare: true,
      userInfo: {},
      supportWorkerIdcardJson: '',
      cardSrcBack: '', //身份证反面
      caregiverPicture: '', //护工证
      editStatus: 1,
      check: false,
      confirmShow: false,
      showPicker: '请选择证件截止时间',
      onType: '', //获取到的护士证书图片认证信息
      onData: {
        status: 0
      }, //判断获取到的认证信息
      bol: false, //判断身份证上传成功
      num: 0, //-1已认证 0未认证 1网络不佳
      tabIndex: 0, //tab切换判断
      tabBars: ['护士职业认证', '护工执业认证'],
      zsType: ['纸质版', '电子版'],
      cardSrcBefore: '', //身份证正面
      showType: [], //v-for type列表
      popTitle: '', //popup title
      popList: '', //popup 选项列表判断
      popData: '', //popup 选中项
      hospital: '', //执业机构
      department: '', //科室
      position: '', //职称
      workingYears: '', //年限
      serviceTypeArr: '',
      data3: {
        type: 0
      },
      data1: {
        identity: 1,
        department: '',
        expirationDate: '',
        homePicture: '', //首页
        hospital: '',
        infoPicture: '', //详情页
        nursePicture: '',
        orderPicture: '', //延续页
        position: '',
        workingYears: '',
        serviceType: '',
        departAddress: '',
        type: 0,
        nurseId: '',
        hospitalAddress: '' ,//医院地址
		nurseSynopsis: ''
      }, //职业认证提交内容
      dataType: 0,
      itemOptions: [
        {
          id: 6,
          value: '上门护理',
          label: '上门护理',
          checked: true
        },
        {
          id: 2,
          value: '就医陪诊',
          label: '就医陪诊',
          checked: true
        },
        {
          id: 4,
          value: '儿科护理',
          label: '儿科护理',
          checked: true
        },
        {
          id: 8,
          value: '核酸检测',
          label: '核酸检测',
          checked: true
        },
        {
          id: 3,
          value: '居家康复',
          label: '居家康复'
        },
        {
          id: 5,
          value: '中医理疗',
          label: '中医理疗'
        },
        {
          id: 1,
          value: '母婴护理',
          label: '母婴护理'
        },
        {
          id: 7,
          value: '推拿按摩',
          label: '推拿按摩'
        },
        {
          id: 9,
          value: '检测服务',
          label: '检测服务'
        }
      ],
      type: {
        homePicture: {
          txt: '首页',
          bg: `background-image:url(../../../static/img/iden/first.png);`,
          src: '',
          src1: ''
        },
        infoPicture: {
          txt: '详情页',
          bg: `background-image:url(../../../static/img/iden/second.png);`,
          src: '',
          src1: ''
        },
        orderPicture: {
          txt: '延续页',
          bg: `background-image:url(../../../static/img/iden/third.png);`,
          src: '',
          src1: ''
        }
      },
      list: [
        {
          txt: '执业机构',
          pla: '请输入执业机构',
          value: '',
          value1: ''
        },
        {
          txt: '所属科室',
          pla: '请选择所属科室',
          value: '',
          value1: ''
        },
        {
          txt: '当前职称',
          pla: '请选择当前职称',
          value: '',
          value1: ''
        },
        {
          txt: '工作年限',
          pla: '请选择工作年限',
          value: '',
          value1: ''
        },
        {
          txt: '服务类目',
          pla: '请选择服务类目',
          value: '',
          value1: ''
        },
        {
          txt: '服务出发地址',
          pla: '请选择服务出发地址',
          value: '',
          value1: ''
        },
        {
          txt: '所属医院',
          pla: '请填写所属医院',
          value: '',
          value1: ''
        },
		{
		  txt: '护士简介',
		  pla: '请填写简介',
		  value: '',
		  value1: ''
		}
      ],
      nurse: ['护士'],
      section: ['全科', '医美', '母婴'],
      demo1: [
        {
          src: '../../../static/img/iden/1.png',
          style: `color: #3c8eff;`,
          judge: '√',
          txt: '标准拍摄'
        },
        {
          src: '../../../static/img/iden/4.png',
          style: `color: rgba(255, 79, 79, 1);`,
          judge: '×',
          txt: '竖向拍摄'
        },
        {
          src: '../../../static/img/iden/2.png',
          style: `color: rgba(255, 79, 79, 1);`,
          judge: '×',
          txt: '拍摄不全'
        },
        {
          src: '../../../static/img/iden/3.png',
          style: `color: rgba(255, 79, 79, 1);`,
          judge: '×',
          txt: '拍摄模糊'
        }
      ],
      demo2: [
        {
          src: '../../../static/img/iden/notice-one.png',
          style: `color: #3c8eff;`,
          judge: '√',
          txt: '标准拍摄'
        },
        {
          src: '../../../static/img/iden/notice-two.png',
          style: `color: rgba(255, 79, 79, 1);`,
          judge: '×',
          txt: '竖向拍摄'
        },
        {
          src: '../../../static/img/iden/notice-three.png',
          style: `color: rgba(255, 79, 79, 1);`,
          judge: '×',
          txt: '拍摄不全'
        },
        {
          src: '../../../static/img/iden/notice-four.png',
          style: `color: rgba(255, 79, 79, 1);`,
          judge: '×',
          txt: '拍摄模糊'
        }
      ],
      result: '',
      nurseId: '',
      timeValue: '',
      valueFirst: '',
      pictureItem: '',
      city: ''
    }
  },
  onLoad(option) {
    this.getMision()
    this.getAtte()
    this.select()
    this.showType = this.type
    // 身份认证 或 执业认证方式
    if (option.type) {
      this.tabIndex = Number(option.type)
      console.log('this.tabIndex', this.tabIndex)
    }
    if (this.data1.type) {
      this.data1.type = this.dataType
    }
    uni.$on('departAddress', res => {
      let _this = this
      _this.list[5].value = res.myaddress
      _this.data1.departAddress = res.myaddress
      _this.data1.departAddressCity = res.city
      console.log('_this.data1.departAddress000', _this.data1.departAddressCity)
    })
    this.getCurrentDate()
  },

  onShow() {
    this.getMision()
    // let tab = -1
    // try {
    // 	tab = uni.getStorageSync('tab')
    // } catch (e) {
    // 	console.log('error777777-------', e)
    // }

    // if (tab == 1) {
    // 	uni.removeStorageSync('tab')
    // 	this.tabIndex = 1
    // }
    // console.log(this.$store.state.address,this.$store.state.userInfo.attestStatus,'首页的')
    this.data1.type = this.dataType
    // console.log(this.data1.type);
  },
  computed: {
    //tab切换样式
    tabStyle(index) {
      var num = this.tabIndex
      return function (index) {
        var style
        if (num == index) {
          return (style = `width: 216rpx;
							background: rgba(255, 255, 255, 0.3);
							border: 2rpx solid rgba(255, 255, 255, 0.3);`)
        } else {
          if (index == 0) {
            return (style = `margin-right:-14rpx`)
          } else {
            return (style = `margin-left:-14rpx`)
          }
        }
      }
    },
    //年限
    year() {
      let arr = ['大于20年']
      for (let i = 20; i > 0; i--) {
        arr.unshift(i + '年')
      }
      return arr
    }
  },
  watch: {
    tabIndex(newValue, oldValue) {
      let titleMap = {
        0: '护士职业认证',
        1: '护工职业认证',
        2: '理疗师职业认证',
        5: '陪诊师认证'
      }
      uni.setNavigationBarTitle({
        title: titleMap[newValue]
      })
    }
  },
  methods: {
    handleTouchStart(e) {
      this.touchStartTime = e.timeStamp
    },
    previewImage() {
      uni.previewImage({
        current: 0,
        urls: [this.oRcodeImg],
        success: function (res) {},
        fail: function (res) {},
        complete: function (res) {
          console.log(res)
        }
      })
    },
    getOrCode() {
      uni.downloadFile({
        url: this.oRcodeImg,
        success: downloadResult => {
          if (downloadResult.statusCode === 200) {
            // 下载成功，保存图片到相册
            uni.saveImageToPhotosAlbum({
              filePath: downloadResult.tempFilePath,
              success: () => {
                uni.showToast({
                  title: '保存成功'
                })
              },
              fail: () => {
                uni.showToast({
                  title: '保存失败',
                  icon: 'none'
                })
              }
            })
          }
        },
        fail: () => {
          uni.showToast({
            title: '下载失败',
            icon: 'none'
          })
        }
      })
    },
    getORcodeImg() {
      let ori = this.city.substring(0, 3)
      if (ori == '内蒙古' || ori == '黑龙江') {
        this.city = ori
      } else {
        this.city = ori.substring(0, 2)
      }

      console.log('oooo', this.city)
      if (Object.keys(orCodeInfo).includes(this.city)) {
        this.oRcodeImg = orCodeInfo[this.city]
      } else {
        console.log('meimei 找到了city')
      }
    },
    async getMision() {
      if (uni.getSystemInfoSync().platform == 'android') {
        // 安卓权限查询
        this.loc = await permision.checkAndroidSelfPermission('android.permission.WRITE_EXTERNAL_STORAGE')
        console.log('anzhuo', this.loc)
      }
    },
    openMessage(value, item) {
      let that = this
      this.getMision()
      that.valueFirst = value
      that.pictureItem = item
	  console.log("that.pictureItem",that.pictureItem)
      if (this.loc == -1) {
        that.$refs.message.open()
      } else {
        that.selectPicture()
      }
    },
    selectPicture() {
      if (this.valueFirst == 'first') {
        this.nurseFirst()
      } else if (this.valueFirst == 'picture') {
        this.nursePicture(this.pictureItem)
      }
    },
    closeMessage() {
      this.$refs.message.close()
    },
    //用户实名 和 认证状态
    async getAtte() {
      let nurseId = this.$store.state.userInfo.id
      let res = await getLoginInfo({
        nurseId
      })
      if (res.success) {
        this.userInfo = res.object //this.userInfo.attestStatus
        let attestStatus = res.object.attestStatus == 2 ? true : false
        this.$store.commit('setAttestStatus', attestStatus)
        this.$store.commit('setUserInfo', res.object)
        if (attestStatus) {
          this.select()
          this.tabIndex = res.object.identity - 1
        }
      }
    },
    tabChange(index) {
      if (this.userInfo.attestStatus === 2) {
        if (this.userInfo.identity === 1 && index === 1) {
          return
        }
        if (this.userInfo.identity === 2 && index === 0) {
          return
        }
      } else {
        this.tabIndex = index
        this.data1.type = 0
      }
    },
    //上传护工证
    async idCareCard() {
      let res = await this.upLoad()
      this.caregiverPicture = res
      console.log(res, '护工证')
    },
    getCurrentDate() {
      var date = new Date()
      var day = date.getDate() + 1
      var year = date.getFullYear()
      var month = date.getMonth() + 1
      month = month > 9 ? month : '0' + month
      day = day < 10 ? '0' + day : day
      this.currentDate = year + '-' + month + '-' + day
    },

    //身份证正面上传
    async idCard() {
      let res = await this.upLoad()
      if (res) {
        this.cardSrcBefore = res
        console.log('111111', this.cardSrcBefore)
        // this.num = 0
        // // #ifdef APP-PLUS
        // plus.nativeUI.toast('上传成功')
        // // #endif
      }
    },
    //身份证反面上传
    async idCardBack() {
      console.log(1)
      let res = await this.upLoad()
      if (res) {
        this.cardSrcBack = res
        console.log('111111', this.cardSrcBack)
      }
    },
    //认证时未定位跳转定位
    bindBtn(type) {
      if (type == 'confirm') {
        uni.navigateTo({
          url: '../../address/select-address/select-address?atte=true'
        })
      } else {
        uni.navigateBack({
          delta: 1
        })
      }
    },
    //职业认证上传护士资格证书
    async nurseFirst() {
      let _this = this
      if (_this.loc == -1) {
        this.closeMessage()
      }
      if (this.onData.status == 1 && this.onData.status == 2) {
        this.remind()
      } else {
        let res = await this.upLoad()
        console.log('首页',res)
        this.data1.nursePicture = res
        console.log(this.data1.nursePicture, '首页')
      }
    },
    //证书类型下的三张图片
    async nursePicture(item) {
      let _this = this
      if (_this.loc == -1) {
        this.closeMessage()
      }
      if (this.onData.status == 1 && this.onData.status == 2) {
        this.remind()
      } else {
        let res = await this.upLoad()
        item.src = res
      }
    },
    checkboxChangeSure(e) {
      // console.log(e)
      this.check = e.detail.value.length > 0
    },
    formatDate(d) {
      var date = new Date(d)
      var YY = date.getFullYear() + '-'
      var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
      var DD = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
      var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
      var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'
      var ss = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
      return YY + MM + DD + ' ' + hh + mm + ss
    },

    //选择证件时间
    changeDatetimePicker(date) {
      this.timeValue = this.formatDate(date.dt)
      console.log('expirationDate', this.data1.expirationDate)
    },
    //证书类型选择
    typeChange(index) {
      this.dataType = index
      // console.log(this.dataType);
      this.data1.type = index
      if (index == 0) {
        this.showType = this.type
      } else if (index == 1) {
        delete this.data1.homePicture
        delete this.data1.orderPicture
        this.showType = {}
        this.showType.infoPicture = this.type.infoPicture
      }
      console.log(this.data1.type, index)
    },
    //其他信息列表
    change(index) {
      if (this.onData.status == 2 || this.onData.status == 1) {
        this.remind()
      } else {
        switch (index) {
          case 0:
            break
          case 1:
            this.$refs.popup.open()
            this.popTitle = '选择所属科室'
            this.popList = 1
            break
          case 2:
            this.$refs.popup.open()
            this.popTitle = '选择当前职称'
            this.popList = 2
            break
          case 3:
            this.$refs.popup.open()
            this.popTitle = '选择工作年限'
            this.popList = 3
            break
          case 4:
            this.$refs.popup.open()
            this.popTitle = '选择服务类目'
            this.popList = 4
            break
          case 5:
            uni.navigateTo({
              url: '../../address/input-address/index?type=departAddress'
            })
            break
        }
      }
    },
    //	科室选择
    checkboxChange(event) {
      // console.log(event);
      this.data1.department = event.detail.value
    },
    //职称选择
    radioChange(event) {
      this.data1.position = event.detail.value
    },
    // 类目选择
    itemChange(e) {
      // console.log(e.detail.value, 'eeeee')
      this.itemOptions = this.itemOptions.map(m => {
        m.checked = false
        return m
      })
      this.itemOptions = this.itemOptions.map(m => {
        if (e.detail.value.indexOf(m.value) > -1) {
          m.checked = true
        }
        return m
      })
      this.data1.serviceType = e.detail.value.join(',')
      this.serviceTypeArr = e.detail.value.join(',')
    },
    //年限选择
    yearChange(event) {
      this.data1.workingYears = event.detail.value
    },
    //取消按钮 关闭 popup
    popDel() {
      this.$refs.popup.close()
    },
    //popup 确定按钮
    confirm() {
      if (this.popList == 1) {
        this.list[1].value = this.data1.department
      } else if (this.popList == 2) {
        this.list[2].value = this.data1.position
      } else if (this.popList == 3) {
        this.list[3].value = this.data1.workingYears
      } else if (this.popList == 4) {
        this.serviceTypeArr = []
        this.itemOptions.map(m => {
          if (m.checked) {
            this.serviceTypeArr.push(m.value)
          }
        })
        this.list[4].value = this.serviceTypeArr.join(',')
        this.data1.serviceType = this.serviceTypeArr.join(',')
      }
      this.$refs.popup.close()
    },
    //保存执业信息
    save: debounce(
      async function () {
        console.log('提交方法')
        if (!this.check) {
          plus.nativeUI.toast('请阅读护士上门流程!')
          return
        }
        if (this.data1.type == 0) {
          this.data1.homePicture = this.showType.homePicture.src
          this.data1.infoPicture = this.showType.infoPicture.src
          this.data1.orderPicture = this.showType.orderPicture.src
        } else {
          this.data1.infoPicture = this.showType.infoPicture.src
        }

        this.data1.nurseId = this.nurseId
        this.data1.identity = 1
        let data2 = this.data1
        data2.type = this.dataType
        if (data2.type == 0) {
          console.log('0纸质', data2)
          console.log(data2.type)
          if (data2.nursePicture == '' || data2.nursePicture == null) {
            uni.showToast({
              icon: 'none',
              title: '请上传护士资格证书'
            })
          } else if (this.timeValue == '') {
            uni.showToast({
              icon: 'none',
              title: '请选择证件截止日期'
            })
          } else if (data2.homePicture == '' || data2.homePicture == null) {
            uni.showToast({
              icon: 'none',
              title: '请上传证书首页'
            })
          } else if (data2.infoPicture == '' || data2.infoPicture == null) {
            uni.showToast({
              icon: 'none',
              title: '请上传证书详情页'
            })
          } else if (data2.orderPicture == '' || data2.orderPicture == null) {
            uni.showToast({
              icon: 'none',
              title: '请上传证书延续页'
            })
          } else if (data2.hospital == '' || data2.hospital == null) {
            uni.showToast({
              icon: 'none',
              title: '请输入执业机构'
            })
          } else if (data2.department == '' || data2.department == null) {
            uni.showToast({
              icon: 'none',
              title: '请选择所属科室'
            })
          } else if (data2.position == '' || data2.position == null) {
            uni.showToast({
              icon: 'none',
              title: '请选择当前职称'
            })
          } else if (data2.workingYears == '' || data2.workingYears == null) {
            uni.showToast({
              icon: 'none',
              title: '请选择工作年限'
            })
          } else if (data2.serviceType == '' || data2.serviceType == null) {
            uni.showToast({
              icon: 'none',
              title: '请选择服务类目'
            })
          } else if (data2.departAddress == '' || data2.departAddress == null) {
            uni.showToast({
              icon: 'none',
              title: '请选择服务出发地址'
            })
          } else if (data2.hospitalAddress == '' || data2.hospitalAddress == null) {
            uni.showToast({
              icon: 'none',
              title: '请填写所属医院'
            })
          } else if (!data2.nurseSynopsis ) {
            uni.showToast({
              icon: 'none',
              title: '请填写护士简介'
            })
          }else {
            data2.expirationDate = this.timeValue
            console.log('data2,,,,,,,,', data2)
            let res = await nurseCheckInfo(data2)
            console.log('res.......', res)
            if (res.success) {
              // #ifdef APP-PLUS
              plus.nativeUI.toast('提交成功，预计1-3个工作日完成审核！')
              // #endif
              setTimeout(() => {
                // uni.navigateBack({
                // 	delta: 1
                // })
                uni.navigateTo({
                  url: '../iden/success'
                })
              }, 200)
            }
          }
        }
        if (data2.type == 1) {
          console.log('1电子', data2)
          if (data2.nursePicture == '' || data2.nursePicture == null) {
            uni.showToast({
              icon: 'none',
              title: '请上传护士资格证书'
            })
          } else if (this.timeValue == '') {
            uni.showToast({
              icon: 'none',
              title: '请选择证件截止日期'
            })
          } else if (data2.infoPicture == '' || data2.infoPicture == null) {
            uni.showToast({
              icon: 'none',
              title: '请上传证书详情页'
            })
          } else if (data2.hospital == '' || data2.hospital == null) {
            uni.showToast({
              icon: 'none',
              title: '请输入执业机构'
            })
          } else if (data2.department == '' || data2.department == null) {
            uni.showToast({
              icon: 'none',
              title: '请选择所属科室'
            })
          } else if (data2.position == '' || data2.position == null) {
            uni.showToast({
              icon: 'none',
              title: '请选择当前职称'
            })
          } else if (data2.workingYears == '' || data2.workingYears == null) {
            uni.showToast({
              icon: 'none',
              title: '请选择工作年限'
            })
          } else if (data2.serviceType == '' || data2.serviceType == null) {
            uni.showToast({
              icon: 'none',
              title: '请选择服务类目'
            })
          } else if (data2.departAddress == '' || data2.departAddress == null) {
            uni.showToast({
              icon: 'none',
              title: '请选择服务出发地址'
            })
          } else if (data2.hospitalAddress == '' || data2.hospitalAddress == null) {
            uni.showToast({
              icon: 'none',
              title: '请填写所属医院'
            })
          } else if (!data2.nurseSynopsis ) {
            uni.showToast({
              icon: 'none',
              title: '请填写护士简介'
            })
          } else {
            //上传纸质版，首页和延续页为空
            data2.orderPicture = ''
            data2.homePicture = ''
            data2.expirationDate = this.timeValue
            console.log('data2232323232', data2)
            let res = await nurseCheckInfo(data2)
            console.log('1电子0000000', data2)
            if (res.success) {
              // #ifdef APP-PLUS
              plus.nativeUI.toast('提交成功，预计1-3个工作日完成审核！')
              // #endif
              setTimeout(() => {
                uni.navigateTo({
                  url: '../iden/success'
                })
              }, 200)
            }
          }
        }
      },
      2000,
      true
    ),
    async clickCare() {
      this.supportWorkerIdcardJson = this.cardSrcBefore + ',' + this.cardSrcBack
      let obj = {
        identity: 2,
        caregiverPicture: this.caregiverPicture,
        supportWorkerIdcardJson: this.supportWorkerIdcardJson,
        type: 0
      }
      console.log(obj)
      let res = await nurseCheckInfo(obj)
      if (res.success) {
        uni.showToast({
          icon: 'none',
          title: '身份审核信息提交成功'
        })
        uni.navigateTo({
          url: '../iden/success'
        })
      }
    },
    // 提交康复师
    async saveRecovered() {
      if (!this.caregiverPicture) {
        return uni.showToast({
          icon: 'none',
          title: '请上传康复师证书'
        })
      }
      //调接口
      let obj = {
        identity: 4,
        caregiverPicture: this.caregiverPicture,
        type: 0
      }
      console.log(obj)
      let res = await nurseCheckInfo(obj)
      if (res.success) {
        uni.showToast({
          icon: 'none',
          title: '身份审核信息提交成功'
        })
        uni.navigateTo({
          url: '../iden/success'
        })
      }
    },
    // 提交理疗师 / 陪诊师
    async savePhysiotherapy() {
      if (!this.cardSrcBefore || !this.cardSrcBack) {
        return uni.showToast({
          icon: 'none',
          title: '请上传完整的身份证照片'
        })
      }
      //调接口
      this.supportWorkerIdcardJson = this.cardSrcBefore + ',' + this.cardSrcBack
      let obj = {
        identity: this.tabIndex + 1,
        supportWorkerIdcardJson: this.supportWorkerIdcardJson,
        type: 0
      }
      console.log(obj)
      let res = await nurseCheckInfo(obj)
      if (res.success) {
        uni.showToast({
          icon: 'none',
          title: '身份审核信息提交成功'
        })
        uni.navigateTo({
          url: '../iden/success'
        })
      }
    },
    /**
     * 提交护工认证
     * @param caregiverPicture
     * @param cardSrcBefore
     * @param   cardSrcBack
     */
    async saveCare() {
      if (this.data3.type == 0) {
        ///1.三个都未上传给提示，不通过
        //2.护工证为空，但是身份证上传的不完整给提示，不通过
        //3.只上传了完整的身份证，护工证为空，通过
        //4.只上传了护工证，身份证为空，通过
        //5.如果上传了护工证，身份证也上传了，要提示上传完整的身份证信息
        console.log(this.cardSrcBack, 'this.cardSrcBack')
        console.log(this.cardSrcBefore, 'this.cardSrcBefore')
        console.log(this.caregiverPicture, 'this.caregiverPicture')
        if (this.caregiverPicture) {
          if (this.cardSrcBack) {
            if (!this.cardSrcBefore) {
              //提示请上传  提示代码来一个 接口加上试试
              uni.showToast({
                icon: 'none',
                title: '请上传完整的身份证照片'
              })
            } else {
              //调接口
              this.clickCare()
            }
          }
          if (this.cardSrcBefore) {
            if (!this.cardSrcBack) {
              //提示请上传
              uni.showToast({
                icon: 'none',
                title: '请上传完整的身份证照片'
              })
            } else {
              //调接口
              this.clickCare()
            }
          }
          if (!this.cardSrcBack && !this.cardSrcBefore) {
            this.clickCare()
          }
        } else {
          //没有上传护工证
          if (this.cardSrcBack) {
            if (!this.cardSrcBefore) {
              //提示请上传
              uni.showToast({
                icon: 'none',
                title: '提示请上传护工证或身份证正反面'
              })
            } else {
              //调接口
              this.clickCare()
            }
          }
          if (this.cardSrcBefore) {
            if (!this.cardSrcBack) {
              //提示请上传
              uni.showToast({
                icon: 'none',
                title: '提示请上传护工证或身份证正反面'
              })
            } else {
              //调接口
              this.clickCare()
            }
          }
        }
      }
    },

    // 更新认证信息
    async updateInfo(nurseId) {
      if (this.onData.subStatus == 1) {
        uni.showToast({
          icon: 'none',
          title: '您的护士资格认证正在审核中，请勿重复认证！'
        })
      } else {
        this.tabIndex = 0
        this.onData.status = 0
        this.data1.type = 0
        this.editStatus = 0
        this.$forceUpdate()
      }
    },

    //查询护士认证信息
    async select() {
      let id = this.$store.state.userInfo.id
      console.log('id', id)
      let res = await selectNurseInfoCheckById({
        id
      })
      if (res.success) {
        this.onData = res.object
        console.log('护士认证数据', this.onData)
        this.nurseId = this.onData.nurseId

        this.data1 = res.object
        this.data1.type = res.object.type

        this.list[0].value = res.object.hospital
        this.list[1].value = res.object.department
        this.list[2].value = res.object.position
        this.list[3].value = res.object.workingYears
        this.list[4].value = res.object.serviceType
        this.list[5].value = res.object.departAddress
        this.city = res.object.departAddress
        this.list[6].value = res.object.hospitalAddress
        this.list[7].value = res.object.nurseSynopsis
        this.type.infoPicture.src = res.object.infoPicture
        if (res.object.orderPicture || res.object.homePicture) {
          this.type.orderPicture.src = res.object.orderPicture
          this.type.homePicture.src = res.object.homePicture
        }
        this.caregiverPicture = res.object.caregiverPicture
        let supportWorkerIdcardJson = res.object.supportWorkerIdcardJson?.split(',')
        if (supportWorkerIdcardJson) {
          this.cardSrcBefore = supportWorkerIdcardJson[0]
          this.cardSrcBack = supportWorkerIdcardJson[1]
        }
        console.log('数据状态', supportWorkerIdcardJson || this.caregiverPicture)
        if (supportWorkerIdcardJson || this.caregiverPicture) {
          this.isSaveCare = false
        }
        this.getORcodeImg()
      }
    },
    //已认证进行的提示
    remind() {
      if (this.onData.subStatus == 1) {
        // #ifdef APP-PLUS
        plus.nativeUI.toast('您的护士资格认证正在审核中，请勿重复认证！')
        // #endif
      } else if (this.onData.subStatus == 3) {
        // #ifdef APP-PLUS
        plus.nativeUI.toast('您的护士资格认证未通过，请重新认证!')
        // #endif
      }
    },
    //上传
    upLoad() {
      return new Promise((resolve, reject) => {
        let _this = this
        uni.chooseImage({
          count: 1, //默认9
          sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
          sourceType: ['album', 'camera'], //从相册选择 拍照
          success: function (res) {
            // console.log(res.tempFiles[0].size, '图片尺寸大小是---');
            translateapp(res.tempFilePaths[0], 80, imgUrl => {
              //打印压缩后返回的图片url
              // console.log(imgUrl, '压缩后的路径')
              uploadImage(
                imgUrl,
                'idCardNurse/',
                result => {
                  resolve(result)
                },
                error => {
                  reject(error)
                  // #ifdef APP-PLUS
                  plus.nativeUI.toast('上传失败')
                  // #endif
                }
              )
            })
          },
          fail(e) {
            if (e.errCode == 11) {
              requestAndroid('android.permission.CAMERA', '摄像头')
            }
          }
        })
      })
    },
    nurseNeed() {
      uni.navigateTo({
        url: './flow'
      })
    }
  }
}
</script>

<style scoped lang="less">
.update-btn1 {
  height: 40%;
  padding-bottom: 2%;
}

.update-btn {
  margin-top: 10%;
  background-color: #508ff6;
  width: 50%;
  height: 90rpx;
  color: #fff;
  font-size: 32rpx;
}

.table {
  width: 750rpx;
  height: 108rpx;
  background: #3c8eff;
  display: flex;
  align-items: center;
  padding-left: 24rpx;
  box-sizing: border-box;
}

.table view {
  width: 216rpx;
  height: 76rpx;
  border-radius: 38rpx;
  color: #ffffff;
  line-height: 76rpx;
  text-align: center;
  // transition: all 1s;
}

.tip {
  width: 100%;
  height: 72rpx;
  background: rgba(255, 106, 0, 0.1);
  // opacity: 0.1;
  font-size: 28rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #ff6a00;
  line-height: 72rpx;
  text-align: center;
}

.saveinto {
  width: 100%;
  height: 144rpx;
  background: rgba(216, 216, 216, 0);
  display: flex;
  justify-content: space-around;
  align-items: center;
  // margin-top: 20rpx;
  box-shadow: 0rpx -6rpx 8rpx 0rpx rgba(0, 0, 0, 0.03);

  .saveCare {
    width: 698rpx;
    height: 96rpx;
    line-height: 96rpx;
    text-align: center;
    background: #3c8eff;
    border-radius: 8rpx;
    font-size: 36rpx;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #ffffff;
  }
}

.upload {
  width: 488rpx;
  height: 324rpx;
  margin: 50rpx auto;
  text-align: center;
  background-size: 488rpx 324rpx;
  position: relative;

  .seal {
    width: 128rpx;
    height: 128rpx;
    position: absolute;
    right: 0;
    bottom: -50rpx;
  }
}

.upload image {
  width: 488rpx;
  height: 324rpx;
  vertical-align: middle;
  margin-bottom: 48rpx;
}

.time {
  width: 90%;
  margin: 0 auto;
  display: flex;
  // height: 100rpx;
  padding: 24rpx 0;
  align-items: center;
  color: #040506;
  border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);

  .other {
    text-align: right;
    padding-left: 20rpx;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #333333;
  }
  
  .other-textarea {
    text-align: right;
    padding-left: 20rpx;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #333333;
  }

}

.time:active {
  opacity: 0.8;
}

.name {
  flex-shrink: 0;
}

.value {
  flex: 1;
}

.time image {
  width: 48rpx;
  height: 48rpx;
}

.zsType {
  justify-content: space-between;
}

.type {
  width: 304rpx;
  height: 64rpx;
  display: flex;
  justify-content: space-between;

  .dui {
    width: 20rpx;
    height: 20rpx;
    border-radius: 12rpx 0rpx 12rpx 0rpx;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #3c8eff;
    position: absolute;
    right: 0;
    bottom: 0;
    box-sizing: border-box;
  }
}

.type1 {
  width: 144rpx;
  height: 64rpx;
  border-radius: 16rpx;
  color: rgba(0, 0, 0, 0.38);
  text-align: center;
  line-height: 64rpx;
  border: 2rpx solid rgba(0, 0, 0, 0.1);
}

.type2 {
  border: 2rpx solid #3c8eff;
  color: #3c8eff;
  background: #ffffff;
}

.pop {
  width: 540rpx;
  height: 620rpx;
  background: #ffffff;
  border-radius: 12rpx;
  position: relative;
}

.popTitle {
  width: 540rpx;
  height: 90rpx;
  border-bottom: 1rpx solid #e5e5e5;
  line-height: 90rpx;
  text-align: center;
  font-weight: 400;
  color: #333333;
  font-size: 32rpx;
  box-sizing: border-box;
}

.confirm {
  height: 88rpx;
  display: flex;
  overflow: hidden;
  box-sizing: border-box;
  border-top: #e5e5e5 1rpx solid;
  position: absolute;
  left: 0;
  bottom: 0;
}

.confirm view {
  width: 270rpx;
  height: 88rpx;
  text-align: center;
  line-height: 88rpx;
  font-size: 32rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #333333;
  box-sizing: border-box;
}

.positive {
  width: 698rpx;
  height: 108rpx;
  background: #ffffff;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  font-size: 32rpx;
  font-family: PingFangSC-Medium, PingFang SC;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.87);

  .left {
    width: 8rpx;
    height: 40rpx;
    background: #3c8eff;
    border-radius: 4rpx;
    margin-right: 16rpx;
  }
}

.head {
  width: 100%;
  height: 40rpx;
  font-size: 28rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #666666;
  line-height: 40rpx;
  text-align: center;
  margin-bottom: 40rpx;
}

.demo {
  padding-top: 58rpx;
  height: 234rpx;
  width: 100%;
  padding-left: 26rpx;
  padding-right: 36rpx;
  display: flex;
  justify-content: space-between;
  box-sizing: border-box;

  // margin-bottom: 190rpx;
  .demo1 {
    image {
      width: 120rpx;
      height: 120rpx;
    }

    .demo2 {
      width: 120rpx;
      height: 34rpx;
      font-size: 24rpx;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #354052;
      line-height: 34rpx;
    }
  }
}

.lose {
  width: 100%;
  height: 300rpx;
  box-sizing: border-box;
  padding-left: 28rpx;
  font-size: 28rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.38);

  // margin-top: 72rpx;
  .loseTip {
    width: 500rpx;
    height: 40rpx;
    display: flex;
    align-items: center;

    .tanhao {
      width: 20rpx;
      height: 20rpx;
      text-align: center;
      line-height: 20rpx;
      background-color: #0055ff;
      margin-right: 10rpx;
    }

    .loseReason {
      width: 364rpx;
      height: 40rpx;
      font-size: 28rpx;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: rgba(0, 0, 0, 0.38);
      line-height: 40rpx;
    }
  }

  .please {
    width: 698rpx;
    height: 112rpx;
    margin-top: 16rpx;
    background: #fafafb;
    padding-left: 32rpx;
    padding-top: 16rpx;
    box-sizing: border-box;
  }
}

.into1 {
  margin-top: 190rpx;
  position: fixed;
  bottom: 0;
  left: 0;
}

.permission-bc {
  background-image: url('http://loto.oss-cn-shanghai.aliyuncs.com/email/5b089870931e40cd.png');
  background-size: 100%;
  background-repeat: no-repeat;
}

.year {
}

.into {
  width: 100%;
  height: 144rpx;
  background: rgba(216, 216, 216, 0);
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 42rpx;
  box-shadow: 0rpx -6rpx 8rpx 0rpx rgba(0, 0, 0, 0.03);

  &.myinto {
    justify-content: flex-start;
  }

  .save {
    width: 698rpx;
    height: 96rpx;
    line-height: 96rpx;
    text-align: center;
    background: #3c8eff;
    border-radius: 8rpx;
    font-size: 36rpx;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #ffffff;
  }
}

.or-img {
  width: 500rpx;
  height: 500rpx;
}
</style>
